/*
 * @Description:LinkedList
 * 
 * @Author: rendc
 * 
 * @Date: 2025-08-12 10:22:50
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-08-12 10:29:19
 */

import java.util.LinkedList;
import java.util.List;

public class TestLinkedList {

  public static void main(String[] args) {
    // 注意 如果要测试LinkedList的独有方法 引用也要指向LinkedList
    LinkedList<String> list = new LinkedList<String>();
    list.add("hello");
    list.add("world");
    list.add("!");
    list.addFirst("first");
    list.addLast("last");
    list.push("push");
    System.out.println("list.getFirst():" + list.getFirst());
    System.out.println("list.getLast():" + list.getLast());
    System.out.println("list.pop():" + list.pop());
    System.out.println("list.pop():" + list.pop());
    System.out.println("list:" + list);

  }
}